﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
namespace DAO
{
    public class AlbumDAO : CommonDAO
    {
        private string add_album = "insert into Album(AlbumName, AlbumDescription, AlbumCover) values (@AlbumName, @AlbumDesc, @AlbumCover)";
        public bool addNewAlbum(string albumName, string albumDesc, string imgPath)
        {
            SqlCommand cmd = this.getCommand(add_album);
            cmd.Parameters.Add("@AlbumName", SqlDbType.VarChar, 50).Value = albumName;
            cmd.Parameters.Add("@AlbumDesc", SqlDbType.NText).Value = albumDesc;
            cmd.Parameters.Add("@AlbumCover", SqlDbType.NVarChar, 256).Value = imgPath;
            int ret = this.ExecuteNonQueryCommand(cmd);
            return ret == 1;
        }
    }
}
